<template>
	<el-drawer title="产品详情" v-model="visible" :size="800" destroy-on-close @closed="$emit('closed')">
		<el-container v-loading="loading">
			<el-main>
				<el-form>
					<el-row :gutter="24">
						<el-col :lg="12">
							<el-form-item label="排序号" prop="sortNo">{{form.sortNo}}
							</el-form-item>
						</el-col>
						<el-col :lg="12">
							<el-form-item label="物料编号" prop="materialCode">{{form.materialCode}}
							</el-form-item>
						</el-col>
					</el-row>
					<el-row :gutter="24">
						<el-col :lg="12">
							<el-form-item label="产品名称" prop="name">{{form.name}}
							</el-form-item>
						</el-col>
						<el-col :lg="12">
							<el-form-item label="所属分类" prop="sortId">{{form.sortName}}
							</el-form-item>
						</el-col>
					</el-row>
					<el-row :gutter="24">
						<el-col :lg="12">
							<el-form-item label="品牌" prop="brand">{{form.brand}}
							</el-form-item>
						</el-col>
						<el-col :lg="12">
							<el-form-item label="产品型号" prop="model">{{form.model}}
							</el-form-item>
						</el-col>
					</el-row>
					<el-row :gutter="24">
						<el-col :lg="12">
							<el-form-item label="价格" prop="price">{{form.price}}元
							</el-form-item>
						</el-col>
						<el-col :lg="12">
							<el-form-item label="指导价" prop="guidePrice">{{form.guidePrice}}/元
							</el-form-item>
						</el-col>
					</el-row>
					<el-form-item label="备注说明">{{form.remark}}
					</el-form-item>
				</el-form>
				<el-footer style="text-align: center;">
					<el-button @click="visible=false">关闭</el-button>
				</el-footer>
			</el-main>
		</el-container>
	</el-drawer>
</template>

<script>
export default {
	emits: ['success', 'closed'],
	components: {
	},
	data() {
		return {
			loading: false,
			form: {
				productId: '',
				sortNo: 0,
				materialCode: '',
				name: '',
				sortName: '',
				brand:'',
				model:'',
				price:0,
				guidePrice:0,
				remark: '',
			},
			visible: false,
			isSaveing: false,
		}
	},
	mounted() {

	},
	methods: {
		//显示
		open(model){
			this.model=model;
			this.visible = true;
			return this;
		},
		//表单注入数据
		setData(data){
			this.form.productId = data.productId
			this.form.sortNo = data.sortNo
			this.form.name = data.name
			this.form.materialCode = data.materialCode
			this.form.sortName = data.sortName
			this.form.brand = data.brand
			this.form.price = data.price
			this.form.model = data.model
			this.form.guidePrice = data.guidePrice
			this.form.remark = data.remark
		},
	}
}
</script>

<style>
</style>
